Fix cross-realm linksTo MIME type handling for file/image defs#4400
Fix cross-realm linksTo MIME type handling for file/image defs#4400
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3f1b20f4c8
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| }); | ||
| let response: Response; | ||
|
|
||
| if(expectsCard){ |
There was a problem hiding this comment.
Default unknown cross-realm links to card MIME
When relationship.data.type is omitted (a valid/stale case already handled above), expectsCard stays false unless the type is explicitly card. In this cross-realm branch that means we now send Accept: application/vnd.card.file-meta+json by default, while the in-realm branch still defaults unknown types to card lookup. As a result, cross-realm card links with missing data.type can negotiate the wrong representation (or fail with media-type errors), causing linked card relationships to stop resolving correctly.
Useful? React with 👍 / 👎.
Host Test Results 1 files ±0 1 suites ±0 2h 29m 37s ⏱️ - 4m 5s For more details on these errors, see this check. Results for commit e06f743. ± Comparison against base commit 72d1f10. |
linear: https://linear.app/cardstack/issue/CS-10730/card-thumbnail-linksto-imagedeffiledef-fails-to-save-for-cross-realm
Previously, cross-realm linksTo requests for file-def and image-def could send an incorrect Accept header and fail with 415 Unsupported Media Type.(from console)

Changes:
Result:
Cross-realm file-def/image-def links resolve correctly.
Eliminates 415 errors caused by wrong media type negotiation.
Screen.Recording.2026-04-14.at.6.56.06.PM.mov